﻿using System.Collections;
using System.Diagnostics;
using System.Windows;

namespace Mvvm.Common.WindowExtensions
{
    public class DefaultShowDialog:IShowDialog
    {
        public bool ShowDialog(Window window, string message, string caption, string okButtonStr)
        {
            return MessageBox.Show(window, message, caption, MessageBoxButton.OK) == MessageBoxResult.OK;
        }

        public bool? ShowDialogResult(Window window, string message, string caption, string okButtonStr, string cancelButtonStr)
        {
            var result = MessageBox.Show(window, message, caption, MessageBoxButton.OKCancel, MessageBoxImage.Question,
                MessageBoxResult.OK);
            return result switch
            {
                MessageBoxResult.OK => true,
                MessageBoxResult.Cancel => false,
                _ => null
            };

        }
    }
}